package com.minimalist.common.entity.lindi.po;

import com.minimalist.common.config.mybatis.InsertFullColumnHandler;
import com.minimalist.common.config.mybatis.UpdateFullColumnHandler;
import com.minimalist.common.config.mybatis.bo.BaseEntity;
import com.mybatisflex.annotation.Table;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

/**
 * 林地指标交易平台_购买申请项目表 实体类。
 *
 * @author 11987
 * @since 2025-07-01
 */
@Table(value = "LINDI_PURCHASE_APPLICATION_PROJECT_ITEM", onInsert = InsertFullColumnHandler.class, onUpdate = UpdateFullColumnHandler.class)
public class LindiPurchaseApplicationProjectItem extends BaseEntity implements Serializable{

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 购买申请ID
     */
    private Long purchaseApplicationId;

    /**
     * 项目ID
     */
    private Long projectId;

    /**
     * 项目名称
     */
    private String projectName;

    /**
     * 项目编号
     */
    private String projectCode;

    /**
     * 项目亩数
     */
    private String projectIndex;

    // 构造函数
    public LindiPurchaseApplicationProjectItem() {
    }

    public LindiPurchaseApplicationProjectItem(Long purchaseApplicationId, Long projectId, String projectName, String projectCode, String projectIndex) {
        this.purchaseApplicationId = purchaseApplicationId;
        this.projectId = projectId;
        this.projectName = projectName;
        this.projectCode = projectCode;
        this.projectIndex = projectIndex;
    }

    // Getter和Setter方法
    public Long getPurchaseApplicationId() {
        return purchaseApplicationId;
    }

    public void setPurchaseApplicationId(Long purchaseApplicationId) {
        this.purchaseApplicationId = purchaseApplicationId;
    }

    public Long getProjectId() {
        return projectId;
    }

    public void setProjectId(Long projectId) {
        this.projectId = projectId;
    }

    public String getProjectName() {
        return projectName;
    }

    public void setProjectName(String projectName) {
        this.projectName = projectName;
    }

    public String getProjectCode() {
        return projectCode;
    }

    public void setProjectCode(String projectCode) {
        this.projectCode = projectCode;
    }

    public String getProjectIndex() {
        return projectIndex;
    }

    public void setProjectIndex(String projectIndex) {
        this.projectIndex = projectIndex;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        if (!super.equals(o)) return false;
        LindiPurchaseApplicationProjectItem that = (LindiPurchaseApplicationProjectItem) o;
        return Objects.equals(purchaseApplicationId, that.purchaseApplicationId) &&
                Objects.equals(projectId, that.projectId) &&
                Objects.equals(projectName, that.projectName) &&
                Objects.equals(projectCode, that.projectCode) &&
                Objects.equals(projectIndex, that.projectIndex);
    }

    @Override
    public int hashCode() {
        return Objects.hash(super.hashCode(), purchaseApplicationId, projectId, projectName, projectCode, projectIndex);
    }

    @Override
    public String toString() {
        return "LindiPurchaseApplicationProjectItem{" +
                "purchaseApplicationId=" + purchaseApplicationId +
                ", projectId=" + projectId +
                ", projectName='" + projectName + '\'' +
                ", projectCode='" + projectCode + '\'' +
                ", projectIndex='" + projectIndex + '\'' +
                '}';
    }

    // Builder模式
    public static Builder builder() {
        return new Builder();
    }

    public static class Builder {
        private Long purchaseApplicationId;
        private Long projectId;
        private String projectName;
        private String projectCode;
        private String projectIndex;

        public Builder purchaseApplicationId(Long purchaseApplicationId) {
            this.purchaseApplicationId = purchaseApplicationId;
            return this;
        }

        public Builder projectId(Long projectId) {
            this.projectId = projectId;
            return this;
        }

        public Builder projectName(String projectName) {
            this.projectName = projectName;
            return this;
        }

        public Builder projectCode(String projectCode) {
            this.projectCode = projectCode;
            return this;
        }

        public Builder projectIndex(String projectIndex) {
            this.projectIndex = projectIndex;
            return this;
        }

        public LindiPurchaseApplicationProjectItem build() {
            return new LindiPurchaseApplicationProjectItem(purchaseApplicationId, projectId, projectName, projectCode, projectIndex);
        }
    }

}
